package org.example.eatback.pojo;


import lombok.Data;

import java.util.Objects;

@Data
public class User {

  private long id;
  private String username;
  private String password;
  private double height;
  private double weight;
  private int age;
  private String gender;

  public double getHeight() {
    return height;
  }

  public void setHeight(double height) {
    this.height = height;
  }

  public double getWeight() {
    return weight;
  }

  public void setWeight(double weight) {
    this.weight = weight;
  }

  public int getAge() {
    return age;
  }

  public void setAge(int age) {
    this.age = age;
  }

  public String getSex() {
    return gender;
  }

  public void setSex(String sex) {
    this.gender = sex;
  }

  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }


  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }


  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }

  @Override
  public String toString() {
    return "User{" +
            "id=" + id +
            ", username='" + username + '\'' +
            ", password='" + password + '\'' +
            ", height=" + height +
            ", weight=" + weight +
            ", age=" + age +
            ", sex='" + gender + '\'' +
            '}';
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    User user = (User) o;
    return id == user.id && Double.compare(height, user.height) == 0 && Double.compare(weight, user.weight) == 0 && age == user.age && Objects.equals(username, user.username) && Objects.equals(password, user.password) && Objects.equals(gender, user.gender);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, username, password, height, weight, age, gender);
  }
}
